package com.sds.common;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

public class Common {

	public static final String DB_URL = "jdbc:oracle:thin:@localhost:1521:XE";
	public static final String DB_CLASS_NAME = "oracle.jdbc.driver.OracleDriver";
	public static final String DB_ID = "scott";
	public static final String DB_PW = "tiger";

	public static final String REAL_ROOT_PATH = "C:/Documents and Settings/student/workspace/RestaurantBoard/WebContent";

	public static Date stringToDate(String strDate) {
		SimpleDateFormat sdf = new SimpleDateFormat("yyyy/MM/dd/HH/mm/ss");
		Date date = null;
		try {
			date = sdf.parse(strDate);
		} catch (ParseException e) {
			return null;
		}
		return date;
	}

	public static Date stringToDate(String strDate, String format) {
		SimpleDateFormat sdf = new SimpleDateFormat(format);
		Date date = null;
		try {
			date = sdf.parse(strDate);
		} catch (ParseException e) {
			return null;
		}
		return date;
	}
}